-
Notifications
You must be signed in to change notification settings - Fork 1
Subsetting added #68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Subsetting added #68
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests.
🚀 New features to boost your workflow:
|
TonioF
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Just a few minor comments, mostly typos.
| if resolution is None: | ||
| if crs is not None and crs.is_geographic: | ||
| resolution = 10 / CONVERSION_FACTOR_DEG_METER | ||
| else: | ||
| resolution = 10 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have almost exactly the same code in get_native_res. You could simplify this by adapting get_native_res
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
get_native_res goes from degree to meter, is crs is geographic. res_native = resolution * CONVERSION_FACTOR_DEG_METER Then after that, the nearest equal or coarser Sentinel-2 spatial resolution is selected.
The part above goes from degree to meter to degree, if crs is geographic. resolution = 10 / CONVERSION_FACTOR_DEG_METER Here, no further selection should be done.
Programmatically it would be possible, but logically it think it would complicate things.
xarray_eopf/amodes/sentinel2.py
Outdated
| crs = pyproj.CRS.from_wkt(ds.spatial_ref.attrs["crs_wkt"]) | ||
| if bbox is None: | ||
| res, ds = next(iter(datasets.items())) | ||
| crs_data = pyproj.CRS.from_wkt(ds.spatial_ref.attrs["crs_wkt"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name 'source_crs' would have made it a lot clearer to me what is happening here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will change crs_data to source_crs
Co-authored-by: Tonio Fincke <[email protected]>
Co-authored-by: Tonio Fincke <[email protected]>
Co-authored-by: Tonio Fincke <[email protected]>
crsresolutionandbbox.